package com.levi.mall.controller;

import com.levi.mall.service.CategoryService;
import com.levi.pojo.Category;
import com.levi.vo.CategoryVo;
import com.levi.vo.ResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author shentong
 * @since 2022/3/28 8:54 PM
 */
@Api(tags = "商品类目接口")
@RestController
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("/categories")
    @ApiOperation("商品类目列表")
    public ResponseVo<List<CategoryVo>> selectAll() {
        return categoryService.seletAll();
    }
}
